// search_activity_cover_info
exports.search_activity_cover_info = function (req, res) {

    var bodyParams = req.routeInfo.bodyParams;
    //最终结果
    var resultData = {};

    //任务流创建
    async.waterfall([
            function (cb) {
                R.SEND_HTTP(
                    req,
                    {
                        url: CORE_APIConfig.coreAPI.searchOrganizationActivityTemplate + "/oat_id/" + bodyParams.template_id,
                        method: 'GET'
                    },
                    function (err, data) {
                        if(err){
                            console.log(data);
                        }
                        resultData.templateData = data.data;

                        cb();
                    }
                );
            },
            function (cb) {
                if (resultData.templateData.length > 0) {
                    var template = resultData.templateData[0];
                    R.SEND_HTTP(
                        req,
                        {
                            url: CORE_APIConfig.coreAPI.searchActivityCover + "/ac_id/" + template.oat_cover_id,
                            method: 'GET'
                        },
                        function (err, data) {

                            resultData.coverData = data.data;

                            cb();
                        }
                    );
                } else {
                    cb()
                }

            }
        ], function (err, result) {

            //返回最终拼接结果
            RES.response(res, true, resultData);

        }
    );

}